<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 100px;
            height: 100px;
            background-color: thistle;
        }
        .box2{
            width: 150px;
            height: 150px;
            background-color: tomato;
        }
        .v-enter{
            opacity: 0;
        }
        .v-enter-to{
            opacity: 1;
        }
        .v-enter-active{
            transition: all 2s;
        }
        .v-leave{
            opacity: 1;
        }
        .v-leave-to{
            opacity: 0;
        }
        .v-leave-active{
            transition: all 2s;
        }

        .scale-enter,.scale-leave-to{
            transform: scale(0);
            opacity: 0;
        }
        .scale-enter-to, .scale-leave{
            transform: scale(1);
            opacity: 1;
        }
        .scale-enter-active, .scale-leave-active{
            transition: all 1s;
        }
    </style>
</head>
<body>
    

    <div id="app">
        <button @click="shark = !shark">点击</button>
        <transition>
            <div class="box" v-show="shark"></div>
        </transition>

        <transition name="scale">
            <div class="box2" v-show="shark"></div>
        </transition>
    </div>

    <script src="../lib/Vue/vue.js"></script>
    <script>

        /*过度的三要素：
		起始状态
		终点状态
		设置过渡属性 
		
		v-enter: 元素进入的一瞬间添加，随后删除
		v-enter-active:和v-enter一起添加的，直到动画完成删除 ，比如动画时间是2秒，2秒后删除
		v-leave :元素离开的一瞬间添加，随后被删除
		v-leave-active:和v-enter一起添加，直到动画完成移除*/

        var vm = new Vue({
            el: '#app',
            data: {
                shark: true
            },
            methods: {
                
            }
        })
    </script>
</body>
</html>